package com.aspose.cells;

public class Hyperlink {
   private HyperlinkCollection c;
   private boolean d;
   private boolean e;
   String a;
   private String f;
   CellArea b;
   private String g;

   Hyperlink(HyperlinkCollection parent, CellArea area) {
      this.c = parent;
      this.b = area;
   }

   void a(boolean var1) {
      this.d = var1;
   }

   void b(boolean var1) {
      this.e = var1;
   }

   public String getAddress() {
      return this.a;
   }

   public void setAddress(String value) {
      this.a = value;
   }

   public String getTextToDisplay() {
      return this.f;
   }

   public void setTextToDisplay(String value) {
      this.f = value;
      Worksheet var2 = this.c.a();
      if (var2 != null) {
         Cells var3 = var2.getCells();
         Cell var4 = var3.a(this.b.StartRow, this.b.StartColumn, false);
         if (var4.c.c == 0 || var4.c.c == 4) {
            var4.putValue(value);
         }

         Font var5 = var2.c().G();
         Style var6 = var4.o();
         var6.getFont().b(var5.getName());
         var6.getFont().setSize(var5.getSize());
         var6.getFont().setBold(false);
         var6.getFont().setItalic(false);
         var6.getFont().setColor(Color.getBlue());
         var6.getFont().setUnderline(1);
         var4.a(var6);
      }

   }

   void a(String var1) {
      Worksheet var2 = this.c.a();
      if (var2 != null) {
         Cells var3 = var2.getCells();
         Cell var4 = var3.a(this.b.StartRow, this.b.StartColumn, false);
         switch(var4.c.c) {
         case 0:
            var4.putValue(var1);
            this.f = var1;
            break;
         case 4:
            this.f = ((zayy)var4.c.d).c;
         }

         Font var5 = var2.c().G();
         Style var6 = var4.o();
         var6.getFont().b(var5.getName());
         var6.getFont().setSize(var5.getSize());
         var6.getFont().setBold(false);
         var6.getFont().setItalic(false);
         var6.getFont().setColor(Color.getBlue());
         var6.getFont().setUnderline(1);
         var4.a(var6);
      }

   }

   void b(String var1) {
      this.f = var1;
   }

   public CellArea getArea() {
      return this.b;
   }

   void a(CellArea var1) {
      this.b = var1;
   }

   Hyperlink() {
   }

   public String getScreenTip() {
      return this.g;
   }

   public void setScreenTip(String value) {
      this.g = value;
   }

   void a(Hyperlink var1) {
      this.a = var1.a;
      this.b = CellArea.c(var1.b);
      this.g = var1.g;
      this.f = var1.f;
   }

   void b(Hyperlink var1) {
      this.a = var1.a;
      this.g = var1.g;
      this.f = var1.f;
   }

   boolean c(Hyperlink var1) {
      return com.aspose.cells.b.a.zv.b(this.a, var1.a) && com.aspose.cells.b.a.zv.b(this.g, var1.g) && com.aspose.cells.b.a.zv.b(this.f, var1.f);
   }

   int a(WorksheetCollection var1) {
      if (this.a != null && !"".equals(this.a)) {
         String var2 = this.a.toLowerCase();
         if (!var2.startsWith("http:") && !var2.startsWith("www.") && !var2.startsWith("https:") && !var2.startsWith("mailto:")) {
            if ((var2.length() <= 1 || var2.charAt(1) != ':') && !var2.startsWith("\\\\")) {
               com.aspose.cells.b.a.g.a.zc var3 = com.aspose.cells.b.a.g.a.ze.a(var2, "^\\w+:", 66);
               if (var3.c()) {
                  return 0;
               } else {
                  if (this.a.indexOf("!") != -1) {
                     String[] var4 = com.aspose.cells.b.a.zv.d(this.a, '!');
                     if (var4.length == 2) {
                        String var5 = var4[0];
                        if (var5.indexOf(92) == -1 && var5.indexOf(47) == -1 && var5.indexOf("file:///") == -1) {
                           return 2;
                        }

                        var5 = com.aspose.cells.b.a.zv.c(var5, '\'');
                        if (zakq.b(var1, var5)) {
                           return 2;
                        }
                     }
                  } else {
                     this.a = com.aspose.cells.b.a.zv.c(this.a, '\'');

                     for(int var6 = 0; var6 < var1.getNames().getCount(); ++var6) {
                        Name var7 = var1.getNames().get(var6);
                        if (var7.getText().equals(this.a)) {
                           return 2;
                        }
                     }
                  }

                  return 1;
               }
            } else {
               return 1;
            }
         } else {
            return 0;
         }
      } else {
         return -1;
      }
   }
}
